package com.scc.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.scc.entity.Answers;
import com.scc.mapper.AnswersMapper;
import com.scc.service.IAnswersService;

@Controller
public class AnswersController {
	@Resource
	private IAnswersService answersService;
	
	@RequestMapping("/myanswer")
	public String show(Answers ans){
		try {
			answersService.answer(ans);
			return "redirect:/showDetails/"+ans.getQid();
		} catch (Exception e) {
			e.printStackTrace();
			return "redirect:/";
		}
	}
}
